import java.util.Scanner;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: ken
 * Date: 2023-10-26
 * Time: 14:06
 */
public class Test {
    public static void main(String[] args) {
        Scanner input = new Scanner(System.in);
        int i = input.nextInt();
        int count =0;
        for(int j = 0;j <= 31;j++) {
            if(((i >> j) & 1) ==1 ) {
                count++;
            }
        }
        System.out.println(count);
    }
    public static void main2(String[] args) {
        Scanner input = new Scanner(System.in);
        int i = input.nextInt();
        int j = input.nextInt();
        for(int k = 2;k <= i;k++) {
            if(i % k == 0 && j % k == 0) {
                System.out.println("最大公约数是"+k);
                break;
            }
        }
    }
    public static void main1(String[] args) {
        double sum1=0;
        double sum2=0;
        for(int i = 1;i <= 100;i++) {
            if(i % 2 ==0) {
                sum2 = sum2 -1.0/i;
            } else {
                sum1 = sum1 + 1.0/i;
            }
        }
       double sum = sum1 +sum2;
        System.out.println(sum);
    }
}
